package com.javafactroy.kunlong.bip.icp.message.base.iface;

import cn.hutool.core.codec.Base64Decoder;
import cn.hutool.core.codec.Base64Encoder;
import com.javafactroy.kunlong.bip.icp.common.consts.IConfig;
import io.netty.buffer.ByteBuf;

public interface IMessage {
    String LINE_SPLIT = "\r\n";
    String FIELD_SPLIT = "|";
    String Algorithm_NONE = "NONE";
    String Algorithm_BASE64 = "BASE64";
    String Algorithm_MD5 = "MD5";
    Base64Encoder encoder = new Base64Encoder();
    Base64Decoder decoder = new Base64Decoder();
    byte[] encode();
    ByteBuf encode2ByteBuf();

    void decode(byte[] buf);
    void check();

    IConfig.INettyConst.MSG_State getMsgState();
    String getMessageId();
    String getMsgType();
}
